package com.securities.stock.controller;

import com.securities.stock.service.CandleService;
import com.securities.stock.service.CandleViewService;
import com.securities.stock.service.StockService;
import com.securities.stock.utils.redis.RedisClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/s")
public class SecuritiesController {

    private static final Logger LOGGER = LoggerFactory.getLogger(SecuritiesController.class);
    @Autowired
    private RedisClient redisClient;

    @Autowired
    private CandleService candleService;

    @Autowired
    private CandleViewService candleViewService;

    @Autowired
    private StockService stockService;

    @GetMapping("/getStocks")
    public ResponseEntity getIdentity() {
        Map map=new HashMap();
        map.put("name","zs");
        map.put("sex",0);
        map.put("age",30);
        redisClient.set("test",map,10);
        LOGGER.info("reids 测试成功");
        return  ResponseEntity.ok(stockService.selectAll());
    }
}
